#ifndef COMMENT_IDENTIFIER_H
#define COMMENT_IDENTIFIER_H

#include "comment_identifier_struct_csv.hpp"
#include "csv_struct.hpp"


class comment_identifier
{
  public:
	comment_identifier() { }

	virtual bool exist(int _comment_identifier_id) =0;
	virtual bool exist(std::string _comment_identifier) =0;

  private:
};



// implementation for csv files

class comment_identifier_csv: public comment_identifier
{
  public:
	comment_identifier_csv(char* filename): file(filename)
	{ }

	bool exist(int _comment_identifier_id)
	{
		csv_struct csv_file(file);
		while(!csv_file.eof())
		{
			++csv_file;
			comment_identifier_struct_csv row(csv_file.get_line());

			if(row.id() == _comment_identifier_id)
				return true;
		}
		return false;
	}

	bool exist(std::string _s)
	{	
		csv_struct csv_file(file);
		while(!csv_file.eof())
		{
			++csv_file;
			comment_identifier_struct_csv row(csv_file.get_line());
			if(row.value() == _s)
				return true;
		}
		return false;
	}


  protected:

  private:
	std::string file;
};
#endif
